import { http } from "@/utils/http";

export type commonResult<T> = {
  code: number;
  msg: string;
  result: T;
};

export type infoType = {

  id?: number,
  unityName?: string,
  projectName?: string,
  smsCount?: number,
  voiceCount?: number,
}
export type infoTypeList = {
  data: infoType[];
  total: number;
};

const List = '/business/setmel/setmel/v2/blance';
const Url = '/business/setmel/setmel/v2/blance';
export const getList = (params?: object) => {
  return http.request<commonResult<infoTypeList>>("get", List, {
    params
  });
};
export const getInfo = (params?: object) => {
  return http.request<commonResult<infoType>>("get", Url, {
    params
  });
};
export const addInfo = (data?: object) => {
  return http.request<commonResult<any>>("post", Url, {
    data
  });
};
export const editInfo = (data?: object) => {
  return http.request<commonResult<any>>("put", Url, {
    data
  });
};
export const deleteInfo = (data?: object) => {
  return http.request<commonResult<any>>("delete", Url, {
    data
  });
};

/** 2.7.3短信/语音套餐充值 */
export const recharge = (data?: object) => {
  return http.request<commonResult<any>>("post", '/business/setmel/setmel/v2/recharge', {
    data
  });
};
/** 2.7.4获取套餐信息 */
export const getRechargeInfo = (data?: object) => {
  return http.request<commonResult<any>>("get", '/business/setmel/setmel/v2/info', {
    data
  });
};